﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Week1.world.behavior
{
    /// <summary>
    /// Do not use this class. Use DrawableGlobals.
    /// </summary>
    public class DrawableGlobalsClass
    {

        public player.Camera oCamera;

        #region Transofrmations
        public Matrix[] oWorld;
        public Vector3[] oPosition;
        public Vector3[] oDirection;
        #endregion

        public float[] fAngleX;
        public float[] fRotateX;
        /* angle and speed of change in angles
        public float[] fAngleY;
        public float[] fAgnelZ;
        public float[] fRotateY;
        public float[] fRotateZ;
        
        public float[] fScaleX;
        public float[] fScaleY;
        public float[] fScaleZ;
        */

        // Number of instance count
        public int iInstanceCount;

        // Actual 3D model
        public Model oModel;
        public string sModelName;
        public Effect oEffect;

        // Reder states
        public DepthStencilState oDepthState;
        public RasterizerState oRasterState;


        /* States. Also used with triggers to trigger a behavior
        public bool[] bPause;
        public bool[] bShotAt;
        public bool[] bMoving;
        public bool[] bTalking;
        public bool[] bActive;
        public bool[] bSHooting;
        public bool[] bVisible;
         * */

        public helper.DebugConsole oConsole;

        // 1 - 100 = land objects, 101 - 200 players, 201 - 300 enemy objects
        public int iObjectType;

        // set in registerBehavior
        const int MAXBEHAVIOR = 10;
        public world.behavior.BehaviorBase[] oBehavior;
        public int iBehaviourCount;
        public int[] iBehaviorHandler;

        public DrawableGlobalsClass(int instanceCount, string modelName, Effect effect, player.Camera camera)
        {
            this.iInstanceCount = instanceCount;
            oBehavior = new BehaviorBase[MAXBEHAVIOR];
            iBehaviorHandler = new int[MAXBEHAVIOR];
            iObjectType = 0;
            iBehaviourCount = 0;
            oCamera = camera;
            oConsole = null;

            oModel = null;
            sModelName = modelName;
            oEffect = effect;

            oDepthState = null;
            oRasterState = null;

            oWorld = new Matrix[instanceCount];
            oPosition = new Vector3[instanceCount];
            oDirection = new Vector3[instanceCount];

            fAngleX = new float[instanceCount];
            fRotateX = new float[instanceCount];
        }


    }
}
